package org.lanqiao.webfm.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import java.io.Serializable;
import java.sql.*;
import java.lang.reflect.*;

import javacommon.base.*;
import javacommon.ijdbc.*;
import javacommon.util.*;
import javacommon.web.page.*;

import org.lanqiao.webfm.model.*;

import org.slf4j.*;

/**
*@Author zhengwei
**/
public class OrdersDetail extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	//date formats
	//columns START
	/**id**/
	private Long id;
	/**行号**/
	private Long rnum;
	/**订单**/
	private Long orderId;
	/**商品**/
	private Long goodsId;
	/**价格**/
	private Long price;
	/**数量**/
	private Long qty;
	//columns END

	public OrdersDetail(){
	}

	public OrdersDetail(Long id){
		this.id = id;
	}

	public void setId(Long value) {
		this.id = value;
	}
	/**id**/
	public Long getId() {
		return this.id;
	}
	public void setRnum(Long value) {
		this.rnum = value;
	}
	/**行号**/
	public Long getRnum() {
		return this.rnum;
	}
	public void setOrderId(Long value) {
		this.orderId = value;
	}
	/**订单**/
	public Long getOrderId() {
		return this.orderId;
	}
	public void setGoodsId(Long value) {
		this.goodsId = value;
	}
	/**商品**/
	public Long getGoodsId() {
		return this.goodsId;
	}
	public void setPrice(Long value) {
		this.price = value;
	}
	/**价格**/
	public Long getPrice() {
		return this.price;
	}
	public void setQty(Long value) {
		this.qty = value;
	}
	/**数量**/
	public Long getQty() {
		return this.qty;
	}
	
	private Orders orders;
	
	public void setOrders(Orders orders){
		this.orders = orders;
	}
	
	public Orders getOrders() {
		return orders;
	}
	
	private Goods goods;
	
	public void setGoods(Goods goods){
		this.goods = goods;
	}
	
	public Goods getGoods() {
		return goods;
	}
	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Rnum",getRnum())
			.append("OrderId",getOrderId())
			.append("GoodsId",getGoodsId())
			.append("Price",getPrice())
			.append("Qty",getQty())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof OrdersDetail == false) return false;
		if(this == obj) return true;
		OrdersDetail other = (OrdersDetail)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

